#ifndef __EPOLLTOOL_H__
#define __EPOLLTOOL_H__

#include <sys/epoll.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <errno.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <fcntl.h>
#include "Event.h"

#define FDSIZE 10000
#define BUFFER_SIZE 1024
#define ET_MODE 1
#define LT_MODE 0

class EpollTool{
public:
    static int Init(int listenfd);
    static int WaitHandle(int epollfd, struct epoll_event* events, int size, int timeout);
    static void AcceptHandler(int listenfd, int epollfd, int enable_et,  Event *event);
    static void LtHandle(struct epoll_event* events, int number, int epollfd, int listenfd, Event *event);
    static void EtHandle(struct epoll_event* events, int number, int epollfd, int listenfd, Event *event);
};


#endif
